import request from '@/utils/request'

/**
 * 查询企业的部门列表
 * @returns
 */
export const reqGetDepartments = () => request({
  method: 'GET',
  url: '/company/department'
})

/**
 *根据部门ID删除部门
 * @param {*} id 部门ID
 * @returns
 */
export const reqDelDepartment = id => request({
  method: 'DELETE',
  url: `/company/department/${id}`
})

/**
 * 新增部门
 * @param {*} data
 * @returns
 */
export const reqAddDepartment = data => request({
  method: 'POST',
  url: '/company/department',
  data
})

/**
 * 根据ID查询部门详情
 * @param {*} id
 * @returns
 */
export const reqGetDepartDetail = id => request({
  url: `/company/department/${id}`
})

export const reqUpdateDepartments = data => request({
  method: 'PUT',
  url: `/company/department/${data.id}`,
  data
})
